import { ISchema } from '@formily/react'

export const MultiLanguageDialog: ISchema = {
  type: 'object',
  properties: {
    'component-group': {
      type: 'void',
      'x-component': 'CollapseItem',
      'x-reactions': {
        fulfill: {
          state: {
            visible: '{{!!$form.values["x-component"]}}',
          },
        },
      },
      properties: {
        'x-component-props': {
          type: 'object',
          properties: {
            dialogName: {
              type: 'string',
              'x-decorator': 'FormItem',
              'x-component': 'Input',
              'x-component-props': {
                placeholder: '请输入对话框名称',
                defaultValue: '多语言对话框',
              },
            },
            formType: {
              type: 'string',
              enum: [
                { label: '输入框', value: 'input' },
                { label: '文本域', value: 'textarea' },
                { label: '富文本编辑器', value: 'editor' },
              ],
              'x-decorator': 'FormItem',
              'x-component': 'Select',
              'x-component-props': {
                defaultValue: 'input',
              },
            },
            nameKey: {
              type: 'string',
              'x-decorator': 'FormItem',
              'x-component': 'Input',
              'x-component-props': {
                placeholder: '请输入字段名称',
                defaultValue: 'content',
              },
            },
          },
        },
      },
    },
  },
}
